#include<iostream>
#include<vector>
using namespace std;
int main()
{
    int num=0;
    int count=0;
    while(cin>>num)
    {
        while(num)
        {
            if(num%2!=0) count++;
            num>>=1;
        }
        cout <<count<<endl;
        count=0;
    }
    
    return 0;
}